package cn.itsource.ymcc.web.controller;


import cn.itsource.result.JSONResult;
import cn.itsource.ymcc.service.ITokenCreateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TokenCreateController {
    @Autowired
    private ITokenCreateService tokenCreateService;


    @GetMapping("/createToken/{courseId}")
    public JSONResult createToken(@PathVariable("courseId")String courseId){
        String tokenStr = tokenCreateService.createToken(courseId);
        return JSONResult.success(tokenStr);
    }
}
